package com.jjb.common.task.service;

import com.jjb.common.ability.adapter.service.IBusinessService;
import com.jjb.common.task.infrastructure.persistence.domainobject.MessageTaskDO;
import com.jjb.common.task.util.JsonUtil;

public interface TaskExecService<T> extends IBusinessService<MessageTaskDO, Boolean> {

    default Boolean execHandler(MessageTaskDO data) {
        return this.exec((T) JsonUtil.parse(data.getExecParam()));
    }

    boolean exec(T data);

}
